<script type="">

    $(document).ready(function(){                    
        $("#open_pop").colorbox({inline:true,width:"450px", height:"255px",opacity:0.1,onLoad: function(){  
                $('#cboxClose').remove();              
            }        
        });        

        $('#create_date').datepicker({
            changeYear: true,
            dateFormat:'dd/mm/yy',                                    
            showOn:'both',           
            buttonImage: '<?=Yii::app()->params["urlRs"]."/images/calendar.png"?>',
            buttonImageOnly: 'true'
        });   

        $(".ui-datepicker-trigger").css("margin-bottom","-5px");
        $(".ui-datepicker-trigger").css("margin-left","5px"); 

    });

    function add_finance(){
        var finance_name = $('#finance_name').val();       
        var finance_spent = $('#finance_spent').val();               
        var finance_description = $('#finance_description').val();               

        if(finance_name == ''){
            alert('Bạn chưa nhập chi tiêu!');return false;
        }

        var strUrl = '<?=$url->createUrl("finance/ajaxSendEmailFinance") ?>';            
        loadingAjax();
        $.ajax({
            type: "GET",
            url: strUrl,
            data: {finance_name:finance_name,finance_spent:finance_spent,finance_description:finance_description},            
            success: function(msg){                            
                if(msg==1){                       
                    alert('Gửi yêu cầu thành công!');
                }
            }
        });

        closeLoadingAjax();
    }    

</script>